The use of the REDEFINES
clause introduces type safety and portability risks, and as such its usage should be avoided where
possible.
Redefines have traditionally been used to solve 2 types of problems:
- Redefines are sometimes used to conserve memory or disk space by compacting many different data types into the same physical data block.
However, these days memory and disk size limitations are no longer key concerns, and the priority of this type of optimisation has declined
significantly. Where space optimisation is still important, normalisation of data schemas should be considered instead.
- Redefines are sometimes used as a quick way of reinterpreting data. A good example would be a date which can be interpretted as a single
string, or separate day-month-year components. In high-performance areas this will give the fastest reformatting, though where performance is not a
concern, a more explicit function gives better long-term flexibility. For instance, if a future change required one of the elements to become
variable length rather than fixed length, the redefine approach would not be able to accomodate the change